// 用户模块
import http from '../request'

// 获取所有城市
export function getCityApi(){
  return http({
    method:'GET',
    url:'/api/shop/city',
  })
}
// 添加地址
export function addAddressApi(data){
  return http({
    method:'POST',
    url:'/api/shop/address',
    data
  })
}
// 获取自己的地址列表
export function getUserAddApi(params){
  return http({
    method:'GET',
    url:'/api/shop/address',
    params
  })
}
// 更新地址信息
export function updateUserAddApi(id,data){
  return http({
    method:'PUT',
    url:`/api/shop/address/${id}`,
    data
  })
}
// 删除地址
export function deleteUserAddApi(id){
  return http({
    method:'DELETE',
    url:`/api/shop/address/${id}`,
  })
}
// 设置默认地址
export function setDefaultAddApi(id){
  return http({
    method:'POST',
    url:`/api/shop/setDefault/${id}`,
  })
}
